//
//  MCCZTXView.m
//  TLYL
//
//  Created by miaocai on 2017/6/22.
//  Copyright © 2017年 TLYL01. All rights reserved.
//

#import "MCCZTXView.h"
#import "MCRechargeViewController.h"
#import "UIView+MCParentController.h"
@interface MCCZTXView()

@property (nonatomic,weak) UIButton *czBtn;

@property (nonatomic,weak) UIButton *txBtn;

@property (nonatomic,weak) UIView *lineView;
@end

@implementation MCCZTXView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setUpUI];
    }
    return self;
}

- (void)setUpUI{
    self.backgroundColor = [UIColor whiteColor];
    UIButton *czBtn = [[UIButton alloc] init];
    [czBtn setTitle:@"充值" forState:UIControlStateNormal];
    [czBtn setImage:[UIImage imageNamed:@"充值"] forState:UIControlStateNormal];
    [czBtn setTitleColor:RGB(39, 38, 54) forState:UIControlStateNormal];
    czBtn.titleLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(15)];
    [czBtn addTarget:self action:@selector(action_recharge) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:czBtn];
    self.czBtn = czBtn;
    UIView *lineView = [[UIView alloc] init];
    
    [self addSubview:lineView];
    
    lineView.backgroundColor = [UIColor darkGrayColor];
    self.lineView = lineView;
    
    UIButton *txBtn = [[UIButton alloc] init];
    [txBtn setTitle:@"提现" forState:UIControlStateNormal];
    [txBtn setImage:[UIImage imageNamed:@"提现"] forState:UIControlStateNormal];
    [txBtn setTitleColor:RGB(39, 38, 54) forState:UIControlStateNormal];
    txBtn.titleLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(15)];
    [txBtn addTarget:self action:@selector(action_withdraw) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:txBtn];
    self.txBtn = txBtn;
}

- (void)layoutSubviews{
    
    [super layoutSubviews];
    
    [self.czBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.equalTo(self);
        make.width.equalTo(@(G_SCREENWIDTH * 0.5 -0.5));
    }];
    
    [self.txBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.top.bottom.equalTo(self);
        make.width.equalTo(@(G_SCREENWIDTH * 0.5 -0.5));
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerX.equalTo(self);
        make.top.equalTo(self).offset(MC_REALVALUE(10));
        make.bottom.equalTo(self).offset(-MC_REALVALUE(10));
        make.width.equalTo(@(1));
    }];
    
}

#pragma mark-充值
-(void)action_recharge{
    MCRechargeViewController * vc = [[MCRechargeViewController alloc]init];
    [[UIView MCcurrentViewController].navigationController pushViewController:vc animated:YES];
}

#pragma mark-提现
-(void)action_withdraw{
    
}


@end
